package com.guang.guiji.javaProgrammingLanguage;


public class Body {
	public long idNum;
	public String name = "<unnamed>";
	public Body orbits;

	public static long nextID = 0;
	
	//public String testAttrSvn;
	//public String testAttrBody;
	
	public Body(){
		idNum = nextID++;
	}
	public Body(String bodyName,Body orbitsAround){
		this();//此句调用构造函数publik Body(){},必须放到第一句
		name=bodyName;
		orbits = orbitsAround;
	}
	public Body(String bodyName){
		this(bodyName,null);
	}
	
	public static void main(String args[]){
		Body body1 = new Body();
		body1.nextID++;
		System.out.println(body1);
		Body body2 = new Body();
		body1.nextID++;
		System.out.println(body1);
		
	}
	
	@Override
	public String toString(){
		
		return ""+this.nextID;
	}
}
